<?php
/**
 * Created by PhpStorm.
 * @author WYZ <wyz@jungo.com.cn>
 * @copyright 深圳市俊网网络有限公司
 */

namespace Selibra\Command;


use Selibra\Di\Annotations\Autowired;
use Selibra\Di\DI;

class ServerProcessManager
{

    /**
     * @var array
     */
    protected static array $processes = [];


    /**
     * @var ServerProcessMessageListener
     */
    #[Autowired]
    protected ServerProcessMessageListener $listener;

    /**
     * @param $pid
     * @param $process
     * @param $serverClass
     */
    public function addServer($pid,$process,$serverClass)
    {
        array_push(self::$processes,[
            'pid' => $pid,
            'process' => $process,
            'serverClass' => $serverClass,
        ]);
        // 消息监听
//        $this->listener->listener($pid,$process,$serverClass);
    }

}